#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/1452/learning/");

	int n;
	cin >> n;
	n = n % (24 * 60 * 60 * 1000) / 1000;

	printf("%02d:%02d:%02d", n / (60 * 60), n / 60 % 60, n % 60);

	return 0;
}
